import request from '@/utils/request'

// 列表
export function getDeviceList (params) {
  return request({
    url: '/v1/app_device/list',
    method: 'get',
    params
  })
}

// 用户设备
export function getUserDeviceList (params) {
  return request({
    url: 'v1/user/history_devices',
    method: 'get',
    params
  })
}

// 新增
export function addDevice (data) {
  return request({
    url: '/v1/app_device/add',
    method: 'post',
    data
  })
}

// 删除
export function removeUserDevice (data) {
  return request({
    url: '/v1/user/clear_history_devices',
    method: 'post',
    data
  })
}

// // 更新
export function updateDevice (data) {
  return request({
    url: `/v1/app_device/update`,
    method: 'put',
    data
  })
}

// // 详情
export function getDeviceDetailById (id) {
  return request({
    url: `/v1/message2/${id}/detail`,
    method: 'get'
  })
}
